stack: Queue a resize/allocate when switching children
authorBenjamin Otte <otte@redhat.com>
Wed, 4 Nov 2015 18:11:14 +0000 (19:11 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 4 Nov 2015 18:39:29 +0000 (19:39 +0100)
We only allocate a size to the currently visible child, so we obviously
need to rerun allocation when the visible child changes.

In the case where the stack is not homogenous, we also need to queue a
resize because our size request just changed.

gtk/gtkstack.c

index 2f8b0f0dd0a9cfdab5c1104a3b37875b005f8534..edce6f4d07bde28530c8259d53b007c2a164c556 100644 (file)
@@ -1145,6 +1145,11 @@ set_visible_child (GtkStack               *stack,
       transition_type = get_simple_transition_type (i_first, transition_type);
     }
 
+  if (priv->hhomogeneous && priv->vhomogeneous)
+    gtk_widget_queue_allocate (widget);
+  else
+    gtk_widget_queue_resize (widget);
+
   g_object_notify_by_pspec (G_OBJECT (stack), stack_props[PROP_VISIBLE_CHILD]);
   g_object_notify_by_pspec (G_OBJECT (stack),
                             stack_props[PROP_VISIBLE_CHILD_NAME]);